<template>
    <div class="notice-list" v-loading="loading">
        <common-list @resert="resert" ref="commonListRef">
            <!-- <template #State="{ scope }">
                <text class="unread" v-if="scope.scope.row.State === 0">未读</text>
                <text class="read" v-else>已读</text>
            </template> -->
        </common-list>
    </div>
</template>

<script setup>
import { provide, reactive, ref } from "vue";
import { tableConfig, formConfig } from "./config";
import { getAlarmInformation } from "@/service/api/PLCalarmInformation.js";
import commonList from "@/components/commonList.vue";

const commonListRef = ref(null);
const formData = reactive({ equipmentCode: "" });

const resert = () => {
    Object.keys(formData).forEach((key) => (formData[key] = ""));
};

provide("formData", formData);
provide("formConfig", formConfig);
provide("tableConfig", tableConfig);
provide("apiFn", getAlarmInformation);
provide("title", "PLC报警消息");
</script>

<style lang="less" scoped>
.notice-list {
    height: 100%;
    .unread {
        background: rgba(0, 66, 142, 0.2);
        font-size: 12px;
        color: #00428e;
        padding: 3px 5px;
    }
    .read {
        background: #ebebeb;
        font-size: 12px;
        color: #8c8c8c;
        padding: 3px 5px;
    }
    .btns {
        display: flex;
        .resert {
            border: 1px solid @main-color;
            color: @main-color;
        }
    }
}
</style>
